/*
package com.shiku.payment.plugin;

import com.shiku.payment.channel.alipay.AliPayProperties;
import com.shiku.payment.channel.alipay.util.AliPayUtil;
import com.shiku.payment.constant.PayConstant;
import com.shiku.payment.entity.PaymentChannelDO;
import com.shiku.payment.service.PaymentChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class PaymentInitPlugin implements CommandLineRunner {

    @Autowired
    private PaymentChannelService paymentChannelService;

    @Autowired
    private AliPayProperties aliPayProperties;

    @Override
    public void run(String... args) throws Exception {

        initPaymentChannel();
        AliPayUtil.setAppConfig(aliPayProperties);
    }


    public void initPaymentChannel(){
        if(null==paymentChannelService.queryPaymentChannel(PayConstant.PAY_CHANNEL_BALANCE)){
            PaymentChannelDO balanceChannel=new PaymentChannelDO();
            balanceChannel.setChannelId(PayConstant.PAY_CHANNEL_BALANCE);
            balanceChannel.setChannelName("余额支付");
            balanceChannel.setStatus(PayConstant.PAY_CHANNEL_ENABLE);

            paymentChannelService.addPaymentChannel(balanceChannel);
        }
        if(null==paymentChannelService.queryPaymentChannel(PayConstant.PAY_CHANNEL_ALIPAY)){
            PaymentChannelDO aliChannel=new PaymentChannelDO();
            aliChannel.setChannelId(PayConstant.PAY_CHANNEL_ALIPAY);
            aliChannel.setChannelName("支付宝支付");
            aliChannel.setStatus(PayConstant.PAY_CHANNEL_DISABLE);

            paymentChannelService.addPaymentChannel(aliChannel);
        }

        if(null==paymentChannelService.queryPaymentChannel(PayConstant.PAY_CHANNEL_WXPAY)){
            PaymentChannelDO wxChannel=new PaymentChannelDO();
            wxChannel.setChannelId(PayConstant.PAY_CHANNEL_WXPAY);
            wxChannel.setChannelName("微信支付");
            wxChannel.setStatus(PayConstant.PAY_CHANNEL_DISABLE);

            paymentChannelService.addPaymentChannel(wxChannel);
        }







    }
}
*/
